package permissions

import (
	"context"
	"goAdminV1/internal/model"
	"goAdminV1/utility"

	"goAdminV1/api/permissions/v1"
)

func (c *ControllerV1) DepartmentDelete(ctx context.Context, req *v1.DepartmentDeleteReq) (res *v1.DepartmentDeleteRes, err error) {
	err = model.DepartmentsDelete(ctx, req.Id)
	if err != nil {
		return nil, utility.Error(utility.CodeOperation, err)
	}
	res.Message = "部门删除成功"
	return res, nil
}
